$id = bersih($var[4]); $perintah = "select id,nama,oleh,ringkas,lengkap,gambar1,gambar,create_date,alias,views,tags from tbl_$kanal where id='$id'"; $hasil = sql($perintah); $data = sql_fetch_data($hasil); $idcontent = $data['id']; $nama=$data['nama']; $oleh = $data['oleh']; $lengkap= $data['lengkap']; $tanggal = tanggal($data['create_date']); $gambar = $data['gambar1']; $gambarshare = $data['gambar']; $ringkas = $data['ringkas']; $alias = $data['alias']; $views = $data['views']; $tags = $data['tags']; if(empty($katid)) $katid="0"; //Sesuaikan dengan path $lengkap = str_replace("jscripts/tiny_mce/plugins/emotions","$domain/plugin/emotion",$lengkap); $lengkap = str_replace("../../","/",$lengkap); $tpl->assign("detailid",$idcontent); $tpl->assign("detailnama",$nama); $tpl->assign("detaillengkap",$lengkap); $tpl->assign("detailringkas",$ringkas); $tpl->assign("detailcreator",$oleh); $tpl->assign("detailtanggal",$tanggal); $tpl->assign("detaildate",$data['create_date']); if(!empty($gambar)) $tpl->assign("detailgambar","$fulldomain/gambar/$kanal/$gambar"); if(!empty($gambarshare)) $tpl->assign("detailgambarshare","$fulldomain/gambar/$kanal/$gambarshare"); //assign fasilitas penunjang if($fasilitasprint) $tpl->assign("urlprint","$fulldomain/$kanal/print/$katid/$idcontent"); if($fasilitaspdf) $tpl->assign("urlpdf","$fulldomain/$kanal/pdf/$katid/$idcontent"); if($fasilitasemail) $tpl->assign("urlemail","$fulldomain/$kanal/kirim/$katid/$idcontent"); if($fasilitasarsip) $tpl->assign("urlarsip","$fulldomain/$kanal/arsip/$secalias"); if($fasilitasrss) $tpl->assign("urlrss","$fulldomain/$kanal/rss"); sql_free_result($hasil); // Masukan data kedalam statistik $stats = number_format($views,0,0,"."); $tpl->assign("detailviews",$stats); $views = "update tbl_$kanal set views=views+1 where id='$id'"; $hsl = sql($views); include($lokasiweb."/vendor/autoload.php"); $fdom = str_replace("https","http",$fulldomain); if(empty($oleh)) $oleh = "Iis Siti Salamah Azzahra"; $html = ""; $html .= "
$lengkap
"; $html .= "Kata Kunci : $tags
"; $mpdf = new \Mpdf\Mpdf(['mode' => 'utf-8', 'format' => 'A4-P']); $mpdf->curlAllowUnsafeSslRequests = true; $mpdf->setFooter('{PAGENO}'); $mpdf->WriteHTML($html); $mpdf->Output("$alias.pdf","I"); exit(); ?>